package com.yan.project.controller;

import com.yan.core.annotations.YanAutowired;
import com.yan.core.annotations.YanController;
import com.yan.core.annotations.YanRequestMapping;
import com.yan.core.annotations.YanSecurity;
import com.yan.project.service.IDemoService;

/**
 * TODO
 *
 * @Author: 汪焰
 * @Date: 2020/12/7 22:26
 */
@YanSecurity({"admin"})
@YanController
@YanRequestMapping("/test")
public class TestController {

    @YanAutowired
    private IDemoService demoService;

    /**
     * localhost:8080/test/index1?name=yan
     */
    @YanSecurity({"yan"})
    @YanRequestMapping("/index1")
    public String index1(String name) {
        System.out.println("--------TestController----yan--------");
        return demoService.getName(name);
    }

    /**
     * localhost:8080/test/index2?name=wy
     */
    @YanSecurity({"wy"})
    @YanRequestMapping("/index2")
    public String index2(String name) {
        System.out.println("--------TestController----wy--------");
        return demoService.getName(name);
    }
}
